package org.swim.entity;

import java.io.Serializable;
import java.sql.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;
import javax.persistence.SequenceGenerator;
import javax.persistence.GeneratedValue;

@Entity
@Table(name="richiesteAmicizia")
@SequenceGenerator(name="FRIENDREQUEST_SEQUENCE", sequenceName="FR_SEQ", allocationSize = 1, initialValue=1)
public class FriendRequests implements Serializable {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;
	
	@Id
	@Column(name="idRichiesteAmicizia")
	@GeneratedValue(strategy=GenerationType.AUTO, generator="FRIENDREQUEST_SEQUENCE")
	private int idRichiesta;
	
	@ManyToOne
	@JoinColumn(name="mittente", referencedColumnName="idUtente")
	private User mittente;
	
	@ManyToOne
	@JoinColumn(name="destinatario", referencedColumnName="idUtente")
	private User destinatario;
	
	@Column(name="dataInvio")	
	private Date dataInvio;
	
	@Column(name="approvata")	
	private boolean approvata;
	

	public int getIdRichiesta() {
		return idRichiesta;
	}
	public void setIdRichiesta(int idRichiesta) {
		this.idRichiesta = idRichiesta;
	}

	public User getMittente() {
		return mittente;
	}
	public void setMittente(User mittente) {
		this.mittente = mittente;
	}

	public User getDestinatario() {
		return destinatario;
	}
	public void setDestinatario(User destinatario) {
		this.destinatario = destinatario;
	}
	
	public Date getDataInvio() {
		return dataInvio;
	}
	public void setDataInvio(Date data) {
		this.dataInvio = data;
	}
	
	public boolean isApprovata() {
		return approvata;
	}
	public void setApprovata(boolean approvata) {
		this.approvata = approvata;
	}
	
}
